<template>
  <div>
    <div>
      <a-row type="flex" justify="space-between" align="middle">
        <div class="">
          <a-button
            type="primary"
            @click="
              current = 1;
              search();
            "
            >立即检查
          </a-button>
        </div>
      </a-row>
    </div>
    <a-table
      :columns="columns"
      :data-source="data"
      size="small"
      :pagination="false"
      :loading="loading"
      style="margin-top: 10px"
      rowKey="index"
    >
      <template slot="footer" slot-scope="currentPageData">
        <div class="table-item">**扫描结果***</div>
        <div class="table-item">扫描总共耗时: {{ mockVuln[0].time }}</div>
        <div class="table-item">扫描文件总数: {{ mockVuln[0].fileTotal }}</div>
        <div class="table-item">
          木马文件总数：{{ mockVuln[0].exceptionFile }}
        </div>
      </template>
    </a-table>
  </div>
</template>

<script>
const columns = [
  {
    title: "编号",
    key: "no",
    dataIndex: "no",
  },
  {
    title: "时间",
    key: "time",
    dataIndex: "time",
  },
  {
    title: "文件名",
    key: "filePath",
    dataIndex: "filePath",
  },
  {
    title: "状态",
    key: "status",
    dataIndex: "status",
  },
  {
    title: "木马类型",
    key: "trojanType",
    dataIndex: "trojanType",
  },
];

import { mockVuln } from "@/config/code/data/vuln";

export default {
  components: {},
  data() {
    return {
      columns,
      loading: false,
      mockVuln,
      data: mockVuln[0].detail,
      page: 10,
      current: 1,
      total: 9,

      visible: false,
    };
  },
  methods: {
    currentChange(val) {
      this.current = val;
      this.search();
    },
    search() {
      console.log(this.model);
    },
  },
};
</script>

<style lang="scss" scoped>
.table-item {
  padding: 8px 8px;
  border-bottom: 1px solid #e8e8e8;

  &:last-child {
    border-bottom: none;
  }
}
</style>
